home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 2 #1 / Commodore_Disk_User_Vol.2_1_1988_-.d64 / disk commands (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  82 lines

  1. 10 rem******************************
  2. 20 rem
  3. 30 rem    disk commands demo progs
  4. 40 rem
  5. 50 rem******************************
  6. 60 rem
  7. 100 print "[147]"
  8. 110 print:print tab(10);"direct access demo"
  9. 120 print:print tab(10);"[158]1.  program trace"
  10. 130 print:print tab(10);"2.  read name"
  11. 140 print:print tab(10);"3.  change name"
  12. 150 print:print tab(10);"4.  show bytes free"
  13. 160 print:print tab(10);"5.  read name(again)
  14. 165 [153]:[153]
  15. 170 [161] i$:[139] i$[178]"" [167] 170
  16. 180 [139] i$[179]"1" [176] i$[177]"5"[167] 170
  17. 190 [145] [197](i$) [141] 500,600,700,800,900
  18. 192 [153]:[153] [163]10);"any key to continue"
  19. 195 [161] i$:[139] i$[178]"" [167] 195
  20. 200 [137] 100
  21. 493 [143]
  22. 495 [143] read links
  23. 497 [143]
  24. 500 [159] 8,8,15:[143] open the command channel
  25. 510 [159] 4,8,4,"#":[143] open direct access file
  26. 520 [133] "track and sector please";tr,se
  27. 530 [152]8,"u1:"4;0;tr;se:[143] read contents of track/sector into buffer
  28. 540 [161]#4,t$,s$:[143] read first two bytes into buffer
  29. 550 tr[178][198](t$[170][199](0)):se[178][198](s$[170][199](0)):[143] make sure value is integer
  30. 560 [139] tr[178]0 [167] [160] 4:[160] 8:[142]:[143] end of links
  31. 570 [153] "track number is: ";tr;" sector is: ";se
  32. 580 [137] 530:[143] get next link
  33. 590 [143]
  34. 593 [143]  read disk name
  35. 595 [143]
  36. 600 [159] 8,8,15:[143] open the command channel
  37. 610 [159] 4,8,4,"#":[143] open direct access file
  38. 620 [152]8,"u1:"4;0;18;0:[143] read contents of desired track/sector
  39. 630 [152]8,"b-p:"4;144:[143] point to where you want to read from
  40. 635 [153] "disk name: ";
  41. 640 [129] x[178]1 [164] 16:[143] length of filename
  42. 650 [161]#4,x$:[139] x$[178][199](160)[167] 670:[143] if shifted space end
  43. 660 [153] x$;:[130]:  [143] print out and get next letter
  44. 670 [153]:[160] 4:[160] 8:[143] end
  45. 680 [142]
  46. 690 [143]
  47. 695 [143] change name
  48. 697 [143]
  49. 700 [159] 8,8,15:[143] open the command channel
  50. 710 [159] 4,8,4,"#":[143] open direct access file
  51. 720 [152]8,"u1:"4;0;18;0:[143] read contents of desired track/sector
  52. 730 [152]8,"b-p:"4;144:[143] point to where you want to read from
  53. 732 [153] "old name: ";
  54. 735 [129] x[178]1 [164] 16:[161]#4,x$:[139] x$[178][199](160) [167] x[178]16:[137] 739
  55. 737 [153] x$;
  56. 739 [130] x:[153]:[153]
  57. 740 [133] "enter new name";x$:[139] [195](x$)[177]16 [167] 740
  58. 750 [139] [195](x$)[179]16[167] x$[178]x$[170][199](160):[137] 750:[143] pad out name
  59. 755 [152]8,"b-p:"4;144:[143] point to where you want to write to
  60. 760 [152]4,x$;:[143] change buffer contents
  61. 770 [152]8,"u2:"4;0;18;0:[143] write back to disk
  62. 780 [152]8,"i":[160] 4:[160] 8:[142]
  63. 790 [143]
  64. 795 [143] free bytes
  65. 797 [143]
  66. 800 [159] 8,8,15
  67. 810 [152]8,"m-r"[199](250)[199](2)
  68. 820 [161]#8,x$:[139] x$[178]"" [167] x$[178][199](0)
  69. 830 [152]8,"m-r"[199](252)[199](2)
  70. 840 [161]#8,y$:[139] y$[178]""[167] y$[178][199](0)
  71. 850 [153] [198](x$)[170]256[172][198](y$);" blocks free"
  72. 860 [160] 8:[142]
  73. 890 [143]
  74. 895 [143] disk name 2
  75. 897 [143]
  76. 900 [159] 8,8,15
  77. 910 [152]8,"m-r"[199](144)[199](7)[199](16)
  78. 920 [132]8,x$
  79. 930 [153] "disk name: ";x$
  80. 940 [160] 8
  81. 950 [142]
  82.